Live migration of virtual devices in a scalable input/output (I/O) virtualization (S-IOV) architecture

ABSTRACT

Examples include a method of live migrating a virtual device by creating a virtual device in a virtual machine, creating first and second interfaces for the virtual device, transferring data over the first interface, detecting a disconnection of the virtual device from the virtual machine, switching data transfers for the virtual device from the first interface to the second interface, detecting a reconnection of the virtual device to the virtual machine, and switching data transfers for the virtual device from the second interface to the first interface.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of U.S. Provisional Application No. 62/721,483, filed Aug. 22, 2018.

BACKGROUND

The introduction of the Single Root I/O Virtualization (SR-IOV) and Sharing specification, version 1.1, published Jan. 20, 2010 by the Peripheral Component Interconnect (PCI) Special Interest Group (PCI-SIG), was a notable advancement toward hardware-assisted high performance I/O virtualization and sharing for PCI Express devices. PCI Express (PCIe) is defined by PCI Express Base Specification, revision 4.0, version 1.0, published Oct. 5, 2017. Since then, the compute landscape has evolved beyond deploying virtual machines (VMs) for computer server consolidation to hyper-scale data centers which need to seamlessly add resources and dynamically provision containers. The new computing environment demands increased scalability and flexibility for I/O virtualization.

In big data centers, migration of VMs for purposed of distributing workloads or for maintenance purpose is a common use-case. Each server in the data center might be running hundreds of VMs. When a server needs to be brought down for maintenance, administrators would like to move the VMs running on the server to a different server so the users don't lose connectivity. In cases when a server is overloaded, administrators might also want to move certain VMs from the server to another server in order to distribute the workload on the server to other servers.

Ideally the migration of the VMs should be seamless to the users and there should not be any traffic disruption. Migration of VMs in this seamless manner is called live migration. This is compared with migration of a VM by saving the current state and restoring the state after migration. However, live migration of VMs that have an SR-IOV Virtual Function (VF) is not possible on many hypervisors because the VF is tied to a specific hardware device.

One approach for live migration of a VM running an SR-IOV VF involves creating a teamed interface in the VM with the SR-IOV VF and another interface that is an emulated interface. While the SR-IOV VF is strictly tied to a specific hardware device and has direct access to the hardware registers of the SR-IOV device, the emulated interface can run on any hardware and is a generic emulation of the I/O path provided by all networking devices. By using the emulated device as a failover device during live migration, the dependency on a specific hardware device can be removed.

This approach for creating a live migration solution using an SR-IOV VF involves creating a failover team with an emulated interface and a VF interface. In normal functioning, the VF path is active and the VM is running traffic in an efficient manner. Then during live migration, the VF is ejected and the team fails-over to the emulated interface. The migration of the hardware device happens while the traffic is running on the emulated interface and, after the migration to another server, the VF can be added again to the VM and the teamed interface will switch the data path back to the VF interface.

This approach requires explicit action by the administrator to setup an additional emulated interface in the VM. It also requires an additional action by the user in the VM to create the team interface with the emulated interface and the VF interface. This overhead discourages the use of the teaming as a solution for live migration of VMs in the data center.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example computing system.

FIG. 2 illustrates an example diagram of some high-level differences between the SR-IOV and Scalable I/O virtualization (IOV) architectures.

FIG. 3 illustrates an example diagram of some differences between SR-IOV capable and Scalable IOV capable endpoint devices.

FIG. 4 illustrates an example diagram of a high-level software architecture for Scalable IOV.

FIG. 5 illustrates an example diagram of a logical view of Assignable Device Interfaces (ADIs) with varying numbers of device backend resources, and virtualization software composing virtual device (VDEV) instances with one or more ADIs.

FIG. 6 illustrates a diagram of an example Scalable IOV Designated Vendor Specific Extended Capability (DVSEC) structure.

FIG. 7 illustrates an example high-level translation structure organization for scalable mode address translation.

FIG. 8 illustrates an example diagram of live migration of a VM.

FIG. 9 illustrates an example flow diagram of live migration of a VM.

FIG. 10 illustrates an example of a storage medium.

FIG. 11 illustrates another example computing platform.

DETAILED DESCRIPTION

Embodiments of the present invention disclose a Scalable I/O virtualization (Scalable IOV) architecture and associated host computing platform and endpoint device capabilities. Scalable IOV defines a scalable and flexible approach to hardware-assisted I/O virtualization targeting hyper-scale usages. Scalable IOV builds on an already existing set of PCI Express capabilities, enabling the Scalable IOV architecture to be easily supported by compliant PCI Express endpoint device designs and existing software ecosystems.

Virtualization allows system software called a virtual machine monitor (VMM), also known as a hypervisor, to create multiple isolated execution environments called virtual machines (VMs) in which operating systems (OSs) and applications can run. Virtualization is extensively used in modern enterprise and cloud data centers as a mechanism to consolidate multiple workloads onto a single physical machine while still keeping the workloads isolated from each other. Besides VMs, containers provide another type of isolated environment that are used to package and deploy applications and run them in an isolated processing environment. Containers are constructed as either bare-metal containers that are instantiated as OS process groups or as machine containers that utilize the increased isolation properties of hardware support for virtualization. Containers are lighter weight and can be deployed in much higher density than VMs, potentially increasing the number of container instances on a computing platform by an order of magnitude.

Modern processors provide features to reduce virtualization overhead that may be utilized by VMMs to allow VMs direct access to hardware resources. Intel® Virtualization Technology (Intel® VT) (for IA-32 Intel® Architecture (Intel® VT-x) defines the Intel® processor hardware capabilities to reduce overheads for processor and memory virtualization. Intel® Virtualization Technology (Intel® VT) for Directed I/O (Intel® VT-d) defines the computing platform hardware features for direct memory access (DMA) and interrupt remapping and isolation that can be utilized to minimize overheads of/O virtualization. I/O virtualization refers to the virtualization and sharing of/O devices across multiple VMs or container instances. There are multiple approaches for I/O virtualization that may be broadly classified as either software-based or hardware-assisted.

With software-based I/O virtualization, the VMM exposes a virtual device (such as network interface controller (NIC) functionality, for example) to a VM. A software device model in the VMM or host OS emulates the behavior of the virtual device. The software device model translates virtual device commands to physical device commands before forwarding the commands to the physical device. Such software emulation of devices can provide compatibility to software running within VMs but incurs significant performance overhead, especially for high performance devices. In addition to the performance limitations, emulating virtual device accesses in software can be too complex for programmable devices such as Graphics Processing Units (GPUs) and Field-Programmable Gate Arrays (FPGAs) because these devices perform a variety of functions versus only a fixed set of functions. Variants of software-based I/O virtualization such as ‘device paravirtualization’ and ‘mediated pass-through’ allow the computing platform to mitigate some of the performance and complexity disadvantages with device emulation.

To avoid the software-based I/O virtualization overheads, VMMs may make use of platform support for DMA and interrupt remapping capability (such as Intel® VT-d) to support ‘direct device assignment’ allowing guest software to directly access the assigned device. This direct device assignment provides the best I/O virtualization performance since the VMM is no longer in the way of most guest software accesses to the device. However, this approach requires the device to be exclusively assigned to a VM and does not support sharing of the device across multiple VMs.

Single Root/O Virtualization (SR-IOV) is a PCI-SIG defined specification for hardware-assisted I/O virtualization that defines a standard way for partitioning endpoint devices for direct sharing across multiple VMs or containers. An SR-IOV capable endpoint device may support one or more Physical Functions (PFs), each of which may support multiple Virtual Functions (VFs). The PF functions as the resource management entity for the device and is managed by a PF driver in the host OS. Each VF can be assigned to a VM or container for direct access. SR-IOV is supported by multiple high performance I/O devices such as network and storage controller devices as well as programmable or reconfigurable devices such as GPUs, FPGAs and other emerging accelerators.

In some embodiments, SR-IOV is implemented using PCIe. In other embodiments, interconnects other than PCIe may be used.

As hyper-scale computing models proliferate along with an increasing number of processing elements (e.g., processing cores) on modern processors, a high-volume computing platform (e.g., computer server) is used to host an order of magnitude higher number of bare-metal or machine containers than traditional VMs. Many of these usages such as network function virtualization (NFV) or heterogeneous computing with accelerators require high performance hardware-assisted I/O virtualization. These dynamically provisioned high-density usages (i.e., on the order of 1,000 domains) demand more scalable and fine-grained I/O virtualization solutions than are provided by traditional virtualization usages supported by SR-IOV capable devices.

Scalable IOV as described in embodiments of the present invention herein is a new approach to hardware-assisted I/O virtualization that enables highly scalable and high-performance sharing of I/O devices across isolated domains, while containing the cost and complexity for endpoint device hardware to support such scalable sharing. Depending on the usage model, the isolated domains may be traditional VMs, machine containers, bare-metal containers, or application processes. Embodiments of the present invention primarily refer to isolated domains as VMs, but the general principles apply broadly to other domain abstractions such as containers.

FIG. 1 illustrates an example computing system 100 supporting the Scalable IOV architecture. As shown in FIG. 1 , computing system 100 includes a computing platform 101 coupled to a network 170 (which may be the Internet, for example, or a network within a data center). In some examples, as shown in FIG. 1 , computing platform 101 is coupled to network 170 via network communication channel 175 and through at least one network I/O device 110 (e.g., a network interface controller (NIC)) having one or more ports connected or coupled to network communication channel 175. In an embodiment, network I/O device 110 is an Ethernet NIC. Network I/O device 110 transmits data packets from computing platform 101 over network 170 to other destinations and receives data packets from other destinations for forwarding to computing platform 101.

According to some examples, computing platform 101, as shown in FIG. 1 , includes circuitry 120, primary memory 130, network (NW) I/O device driver 140, operating system (OS) 150, virtual machine manager (VMM) 180 (also known as a hypervisor), at least one application 160, and one or more storage devices 165. In one embodiment, OS 150 is Linux™. In another embodiment, OS 150 is Windows® Server. In an embodiment, application 160 represents one or more application programs executed by one or more guest VMs (not shown). Network I/O device driver 140 operates to initialize and manage I/O requests performed by network I/O device 110. In an embodiment, packets and/or packet metadata transmitted to network I/O device 110 and/or received from network I/O device 110 are stored in one or more of primary memory 130 and/or storage devices 165. In at least one embodiment, storage devices 165 may be one or more of hard disk drives (HDDs) and/or solid-state drives (SSDs). In an embodiment, storage devices 165 may be non-volatile memories (NVMs). In some examples, as shown in FIG. 1 , circuitry 120 may communicatively couple to network I/O device 110 via communications link 155. In one embodiment, communications link 155 is a Peripheral Component Interface Express (PCIe) bus conforming to revision 4.0 or other versions of the PCIe standard. In some examples, operating system 150, NW I/O device driver 140, and application 160 are implemented, at least in part, via cooperation between one or more memory devices included in primary memory 130 (e.g., volatile or non-volatile memory devices), storage devices 165, and elements of circuitry 120 such as processing cores 122-1 to 122-m, where “m” is any positive whole integer greater than 2. In an embodiment, OS 150, NW I/O device driver 140, and application 160 are executed by one or more processing cores 122-1 to 122-m. In other embodiments, there are other endpoint devices coupled to communications link 155 (e.g., PCIe interconnect) that support Scalable IOV capabilities.

In some examples, computing platform 101, includes but is not limited to a computer server, a server array or server farm, a web server, a network server, an Internet server, a work station, a mini-computer, a main frame computer, a supercomputer, a network appliance, a web appliance, a distributed computing system, multiprocessor systems, processor-based systems, a laptop computer, a tablet computer, a smartphone, or a combination thereof. In one example, computing platform 101 is a disaggregated server. A disaggregated server is a server that breaks up components and resources into subsystems. Disaggregated servers can be adapted to changing storage or compute loads as needed without replacing or disrupting an entire server for an extended period of time. A server could, for example, be broken into modular compute, I/O, power and storage modules that can be shared among other nearby servers.

Circuitry 120 having processing cores 122-1 to 122-m may include various commercially available processors, including without limitation Intel® Atom®, Celeron®, Core (2) Duo®, Core i3, Core i5, Core i7, Itanium®, Pentium®, Xeon® or Xeon Phi® processors, ARM processors, and similar processors. Circuitry 120 may include at least one cache 135 to store data.

According to some examples, primary memory 130 may be composed of one or more memory devices or dies which may include various types of volatile and/or non-volatile memory. Volatile types of memory may include, but are not limited to, dynamic random-access memory (DRAM), static random-access memory (SRAM), thyristor RAM (TRAM) or zero-capacitor RAM (ZRAM). Non-volatile types of memory may include byte or block addressable types of non-volatile memory having a 3-dimensional (3-D) cross-point memory structure that includes chalcogenide phase change material (e.g., chalcogenide glass) hereinafter referred to as “3-D cross-point memory”. Non-volatile types of memory may also include other types of byte or block addressable non-volatile memory such as, but not limited to, multi-threshold level NAND flash memory, NOR flash memory, single or multi-level phase change memory (PCM), resistive memory, nanowire memory, ferroelectric transistor random access memory (FeTRAM), magneto-resistive random-access memory (MRAM) that incorporates memristor technology, spin transfer torque MRAM (STT-MRAM), or a combination of any of the above. In another embodiment, primary memory 130 may include one or more hard disk drives within and/or accessible by computing platform 101.

FIG. 2 illustrates an example diagram 200 of some high-level differences between SR-IOV 202 and Scalable IOV 222 architectures. Unlike the coarse-grained device partitioning and assignment approach 208 adopted by SR-IOV to create multiple VFs 214 on a PF 212, the Scalable IOV architecture 222 enables software to flexibly compose virtual devices utilizing hardware assists for device sharing at finer granularity. Frequent (i.e., performance critical) operations on the composed virtual device are mapped directly to the underlying device hardware (e.g., scalable IOV device 230), while infrequent operations are emulated through device-specific composition software 226 in VMM/Host OS 228. This is different than the existing architecture for SR-IOV devices 202, where only the device-agnostic PCI Express architectural resources (such as configuration space registers and message signaled interrupts extended (MSI-X) capability registers) of the virtual device are virtualized in software, and the rest of the virtual device resources (including all other memory mapped I/O (MMIO)) are mapped directly to the underlying VF 214 hardware resources (e.g., SR-IOV device 216).

In the SR-IOV architecture 202 using hardware replication, a plurality of VMs and containers 204 run on top of a VMM and/or host OS 206. Device partitioning and assignment logic 208 assigns I/O requests to PF driver 210 which is coupled with physical function (PF) 212 in SR-IOV device 216, or to virtual functions (VFs) 214 in SR-IOV device 216. In contrast, in the Scalable IOV architecture 222 of embodiments of the present invention using replication and composition, many more VMs and containers 224 are supported. VMs and/or containers 224 call device composition logic 226 in VMM/host OS 228 to implement I/O requests. Device composition logic 226 assigns I/O requests to PF driver 210, which is coupled with fine-grained, provisioned device resources (which also includes physical functions) in Scalable IOV device 230, or directly to fine-grained, provisioned device resources 232 in Scalable IOV device 230.

The Scalable IOV architecture provides benefits over SR-IOV. Fine-grained provisioning of device resources to VMs 224 along with software emulation of infrequent device accesses enables devices to increase sharing scalability at lower hardware cost and complexity. The Scalable IOV architecture provides system software such as VMM/Host OS 228 the flexibility to share device resources with different address domains using different abstractions (e.g., application 160 processes to access through system calls and VMs/containers 224 to access through virtual device interfaces). Through software-controlled dynamic mapping of virtual devices (VDEVs) to device resources, the Scalable IOV architecture of embodiments of the present invention also enables VMMs to over-provision device resources to VMs 224.

The present approach also enables VMMs 228 to easily maintain generational compatibility in a data center. For example, in a data center with physical machines containing different generations (e.g., versions) of the same I/O device, a VMM can use software emulation to virtualize a VDEV's MMIO-based capability registers to present the same VDEV capabilities irrespective of the different generations of physical I/O device. This is to ensure that the same guest OS image with a VDEV driver can be deployed or migrated to any of the physical machines.

The Scalable IOV architecture is composed of the following elements. The architecture supports PCI Express endpoint device requirements and capabilities. The architecture supports host platform (e.g., Root Complex) requirements including enhancements to direct memory access (DMA) remapping hardware. In an embodiment, these requirements are implemented on Intel processor-based computing platforms as part of Intel® Virtualization Technology for Directed I/O, Rev 3.0 or higher. The architecture also supports a reference software architecture envisioned for enabling Scalable IOV, including host system software (OS and/or VMM 228) enabling infrastructure and endpoint device specific software components such as host driver, guest driver, and a virtual device composition module (VDCM).

PCI Express endpoint devices may support requirements to operate with Scalable IOV independent of its support for SR-IOV. This enables device implementations that already support SR-IOV to maintain this capability for backwards compatibility while adding the additional capabilities to support Scalable IOV.

In embodiments of the present invention, an endpoint physical function is capable of both SR-IOV and Intel Scalable-IOV to be enabled to operate in one mode or other, but not concurrently.

The PCI Express SR-IOV architecture follows a near complete functional hardware replication of the Physical Function (PF) 212 hardware for its Virtual Functions (VFs) 214. This is realized by most SR-IOV device implementations by replicating most of the PF's hardware/software interface for each of its VFs, including resources such as memory mapped resources, MSI-X storage and capabilities such as Function Level Reset (FLR). Such a functional replication approach can add to device complexity and impose limitations to scale to large numbers of VFs.

The hardware-software interface for I/O controller implementations can be categorized as (a) slow path control/configuration operations that are less frequent and have the least impact on overall device performance; and (b) fast path command/completion operations that are frequent and have a higher impact on the overall device performance. This distinction of slow path versus fast path operations are practiced by many high performance I/O devices supporting direct user-mode access. The Scalable IOV architecture extends such device designs to define a software composable approach to I/O virtualization and sharing.

The Scalable IOV architecture requires endpoint devices (i.e., scalable IOV devices 230) to organize their hardware/software interfaces into fast path (frequent) and slow path (infrequent) accesses. Which operations and accesses are distinguished as slow path versus fast path is controlled by device implementation. Slow path accesses typically include initialization, control, configuration, management, error processing, and reset operations. Fast path accesses typically include data path operations involving work submission and work completion processing. With this organization, slow path accesses to the virtual device from a guest VM are trapped and emulated by device-specific host software while fast path accesses are directly mapped on to the physical device. This approach enables simplified device designs (compared to SR-IOV full functional replication), without compromising I/O virtualization scalability or performance. Additionally, the hybrid approach provides increased flexibility for software to compose virtual devices through fine-grained provisioning of device resources.

High performance I/O devices support a large number of command/completion interfaces for efficient multiplexing/de-multiplexing of/O requests and in some usages to support user-mode I/O requests. A few examples of such devices are: a) high-bandwidth network controllers supporting thousands of transmit/receive (TX/RX) queues across a large number of Virtual Switch Interfaces (VSIs); b) storage controllers such as NVM Express (as described in the non-volatile memory (NVM) Express specification, version 1.3c, available at nvmexpress.org) devices supporting many command and completion queue pair constructs; c) accelerator devices such as GPUs supporting a large number of graphics and/or compute contexts; d) reconfigurable FPGA devices with Accelerator Functional Units (AFUs) supporting a large number of execution contexts; and e) remote direct memory access (RDMA) capable devices supporting thousands of Queue Pair (QP) interfaces.

The Scalable IOV architecture takes advantage of multi-queue/multi-context capable high performance I/O device designs and defines an approach to share these devices at a finer granularity (queues, queue bundles, contexts, etc.) than SR-IOV VF granularity. To achieve this finer-grained sharing, the Scalable IOV architecture of embodiments of the present invention defines the granularity of sharing of a device as an ‘Assignable Device Interface’ (ADI) on the device. According to an embodiment, an ADI is the unit of assignment for a Scalable IOV capable device. Each ADI instance on the device encompasses the set of resources on the device that are allocated by software to support the fast path operations for a virtual device (VDEV).

Conceptually, ADI is similar to a SR-IOV virtual function (VF), except it is finer-grained and maps to the fast path operations for a virtual device. Unlike VFs, all ADIs on a Physical Function (PF) share the Requester-ID (e.g., Bus/Device/Function number) of the PF, have no PCI configuration space registers, share the same Base Address Register (BAR) resources of the PF (i.e., no virtual function base address registers (VFBARs)), and do not require replicated MSI-X storage. Instead of MSI-X table storage for each ADI, PF implements a device specific Interrupt Message Storage (IMS). IMS is similar to MSI-X table storage in purpose but is not architectural and instead is implemented in a device specific manner for maximum flexibility. Additionally, unlike some SRIOV devices which implement VF⇔PF communication channels and ‘resource remapping logic’ on the device, ADIs use slow-path emulation to provide such functionality. ADI's memory-mapped register space is laid out such that fast path registers are in separate system page size regions than the slow path registers. The host driver for a Scalable IOV capable device defines the collection of device back-end resources that are grouped to form an ADI.

FIG. 3 illustrates an example diagram 300 of some differences between SR-IOV capable and Scalable IOV capable endpoint devices. SR-IOV device 216 includes physical function (PF) base address registers (PF BARs) 302, PF configuration (PF config) circuitry 304, and PF message signaled interrupt extended (MSI-X) circuitry 306. PF MSI-X 306 provides the MSI-X capability as defined by the PCI Express Base Specification. SR-IOV device 216 also includes a plurality of sets of virtual function (VF) VF BARs 312, VF config 314, and MSI-X 316. PF BARs 302 and VF BARs 312 are coupled to device resource remapping logic and VF⇔PF mailbox logic 308, which calls device backend resources 310. In an embodiment, device backend resources 310 includes a plurality of queues for storing packets. Device backend resources 310 may include command/status registers, on device queues, references to in-memory queues, local memory on the device, or any other device specific internal constructs.

Scalable IOV device 230 includes PF BARs 320, which also includes a plurality of ADI MMIO components 322. PF BARS 320 are coupled with PF config 324, PF MSI-X 326, and interrupt message storage (IMS) for ADIs 328. PF MSI-X 326 provides the MSI-X capability as defined by the PCI Express Base Specification. IMS 328 enables devices to store the interrupt messages for ADIs in a device-specific optimized manner without the scalability restrictions of PCI Express defined MSI-X capability. PF BARs 320 and ADI MMIO components 322 are coupled with device backend resources 330. Device backend resources 330 may include command/status registers, on device queues, references to in-memory queues, local memory on the device, or any other device specific internal constructs.

The device-specific and light-weight nature of ADIs, along with the flexibility to emulate portions of the virtual device functionality in device-specific host software, enables device hardware implementations to compose a large number of virtual devices for scalable sharing at lower device cost and complexity compared to equivalent scaling of SR-IOV VFs.

With the SR-IOV architecture, each VF 214 in a SR-IOV device 216 is identified by a PCI Express Requester identifier (ID) (RID), allowing DMA remapping hardware support in Root Complex (such as Intel® VT-d) to apply unique address translation functions for upstream requests from the VF. A RID is a bus, device and function number identity for a PCI Express PF or VF. RIDs are also used for routing transactions such as read completions for the PCI Express device hierarchy, and hence can be a scarce resource on some platform topologies with large I/O fan-out designs. This can impose scalability limitations on the number of isolated domains a SR-IOV device can support.

The Scalable IOV architecture of embodiments of the present invention addresses the platform scalability issue by sharing the RID of the physical function (PF) 232 with all of its ADIs, and instead assigning ADIs a Process Address Space Identifier (PASID) that is conveyed in upstream transactions using a PCI Express PASID transaction layer packet (TLP) Prefix. Refer to the PCI Express specification for details on the PASID TLP Prefix. The computing platform 101 support for the Scalable IOV architecture enables unique address translation functions for upstream requests at PASID granularity. Unlike RID, PASID is not used for transaction routing on the I/O fabric but instead is used only to convey the address space targeted by a memory transaction. Additionally, PASIDs are 20-bit IDs compared to 16-bit RIDs, which gives 16× more identifiers. This use of PASIDs by the Scalable IOV architecture enables significantly more domains to be supported by Scalable IOV devices.

FIG. 4 illustrates an example diagram of a high-level software architecture 400 for Scalable IOV. FIG. 4 illustrates components used to describe the Scalable IOV architecture and is not intended to illustrate all virtualization software or specific implementation choices. To support broad types of device classes and implementations, the software responsibilities are abstracted between system software (OS 150/VMM 180) and device-specific driver software components.

Thus, FIG. 4 is a description of system software (host OS 150 and VMM 180) and device-specific software roles and interactions to compose hardware-assisted virtual devices along with how to manage device operations. The software architecture described is focused on I/O virtualization for virtual machines and machine containers. However, the principles can be applied with appropriate software support to other domains such as I/O sharing across bare-metal containers or application processes.

The Scalable IOV architecture of embodiments of the present invention introduces a device-specific software component referred to as the Virtual Device Composition Module (VDCM) 402 that is responsible for composing one or more virtual device (VDEV) 404 instances utilizing one or more Assignable Device Interfaces (ADIs) 406, 408, which the VDCM does by emulating VDEV slow path operations/accesses and mapping the VDEV fast path accesses to ADI instances allocated and configured on the physical device. Thus, VDCM 402 is a controller of VDEVs. Unlike SRIOV VFs 214, VDCM 402 allows Scalable IOV devices 230 to avoid implementing slow path operations in hardware and instead to focus device hardware to efficiently scale the ADIs.

Additionally, virtualization management software (e.g., a VMM 180) makes use of VDCM 402 software interfaces for enhanced virtual device resource and state management, enabling capabilities such as suspend, resume, reset, and migration of virtual devices. Depending on the specific VMM implementation, VDCM 402 is instantiated as a separate user or kernel module or may be packaged as part of a host driver.

Host driver 412 for a Scalable IOV capable device 230 is conceptually equivalent to a SR-IOV PF driver 210. Host driver 412 is loaded and executed as part of host OS 150 or VMM (hypervisor) software 180. In addition to the role of a normal device driver, host driver 412 implements software interfaces as defined by host OS 150 or VMM 180 infrastructure to support enumeration, configuration, instantiation, and management of a plurality of ADIs 428, 430, 432, 434. Host driver 412 is responsible for configuring each ADI such as its PASID identity, device-specific Interrupt Message Storage (IMS) 328 for storing ADI's interrupt messages, MMIO register resources 322 for fast-path access to the ADI, and any device-specific resources.

Table 1 illustrates an example high-level set of operations that host driver 412 supports for managing ADIs. These operations are invoked through software interfaces defined by specific system software (e.g., host OS 150 or VMM 180) implementations.

TABLE 1 Host driver interfaces for Scalable IOV Description Scalable IOV capability reporting for the PF. Enumeration of types and maximum number of ADIs/VDEVs. Enumeration of resource requirements for each ADI type. Enumeration and setting of deployment compatibility for ADIs. Allocation, configuration, reset, drain, abort, release of ADI and its constituent resources. Setting and managing PASID identity of ADIs. Managing device-specific Interrupt Message Storage (IMS) for ADIs. Enabling guest to host communication channel (if supported). Configuring device-specific QoS properties of ADIs. Enumerating and managing migration compatibility of ADIs. Suspending/saving state of ADIs, and restoring/resuming state of ADIs.

Virtual Device Composition Module (VDCM) 402 is a device specific component responsible for composing one or more virtual device (VDEV) 404 instances using one or more ADIs 406, 408 allocated by host driver 412. VDCM 402 implements software-based virtualization of VDEV 404 slow path operations and arranges for fast path operations to be submitted directly to the backing ADIs 428, 430, 432, 434. Host OS 150 or VMM 180 implementations supporting such hardware-assisted virtual device composition may require VDCM to be implemented and packaged by device vendors in different ways. For example, in some OS or VMM implementations, VDCM 402 is packaged as user-space modules or libraries that are installed as part of the device's host driver 412. In other implementations, VDCM 402 is a kernel module. If implemented as a library, VDCM 402 may be statically or dynamically linked with the VMM-specific virtual machine resource manager (VMRM) responsible for creating and managing VM resources. If implemented in the host OS kernel, VDCM 402 can be part of host driver 412.

Guest driver 424 for a Scalable IOV capable device 230 is conceptually equivalent to a SR-IOV device VF driver. In an embodiment, guest driver 424, resident in guest VM 422, manages VDEV instances 404 composed by VDCM 402. Fast path accesses 426 by guest driver 424 are issued directly to ADIs 432, 434 behind VDEV 404, while slow path accesses 420 are intercepted and virtualized by VM resource manager (VMRM) 416 and VDCM 402. Similar to implementation choices available for SR-IOV PF 212 and VF 214 drivers, for a target OS 150, guest driver 424 is deployed as a separate driver or as a unified driver that supports both host OS 150 and guest VM 422 functionality. For existing SR-IOV devices 216, if VDEV 404 is composed to behave like an existing VF 214, Scalable IOV guest driver 424 can even be the same as the SR-IOV VF 214 driver for backward compatibility.

In embodiments of the present invention, Virtual Device (VDEV) 404 is the abstraction through which a shared physical device (e.g., Scalable IOV device 230) is exposed to software in guest VM 422. VDEVs 404 are exposed to guest VM 422 as virtual PCI Express enumerated devices, with virtual resources such as virtual Requester-ID, virtual configuration space registers, virtual memory BARs, virtual MSI-X table, etc. Each VDEV 404 may be backed by one or more ADIs 428, 430, 432, 434. The ADIs backing a VDEV 404 typically belong to the same PF 232 but implementations are possible where they are allocated across multiple PFs (for example to support device fault tolerance or load balancing).

A PF 232 may support multiple types of ADIs, both in terms of number of device backend resources 330 and in terms of functionality. Similarly, multiple types of VDEV compositions are possible (with respect to the number of backing ADIs, functionality of ADIs, etc.) on a Scalable IOV device 230. VDCM 402 may publish support for composing multiple ‘VDEV types’, enabling a virtual machine resource manager (VMRM) 416 to request different types of VDEV instances for assigning to virtual machines (VMs). VDCM 402 uses host OS 150 and VMM 180 defined interfaces to allocate and configure resources needed to compose a plurality of VDEV 404 instances. VDEV instances may be assigned to VMs 422 in the same way as SR-IOV VFs 214.

VDEV 404 may be composed of a static number of ADIs that are pre-allocated at the time of VDEV instantiation or composed dynamically by VDCM 402 in response to guest driver 424 requests to allocate/free resources. An example of statically allocated ADIs is a virtual NIC (vNIC) with a fixed number of RX/TX queues. An example of dynamically allocated ADIs is a virtual accelerator device, where context allocation requests are virtualized by VDCM 402 to dynamically create accelerator contexts as ADIs.

VDEV's MMIO registers 322 may be composed with any of the following methods for any system page size regions of the VDEV MMIO space.

1) Direct Mapped to ADI MMIO. As part of composing a VDEV instance 404, VDCM 402 defines the system page size ranges in VDEV virtual BARs in guest physical address (GPA) space that need to be mapped to MMIO page ranges of backing ADIs in host physical address (HPA) space. VDCM 402 may request VMM 180 to set up GPA to HPA mappings in the host processor 122-1 . . . 122-M virtualization page tables, enabling direct access by guest driver 424 to the ADI. These direct mapped MMIO ranges support fast path operations 426 to ADIs 432, 434.

2) VDEV MMIO Intercepted and Emulated by VDCM. Slow path registers for a VDEV are virtualized by VDCM 402 by requesting VMM 180 to not map these MMIO regions 322 in the host processor virtualization page tables, thus forcing host intercepts when guest driver 424 accesses these registers. These intercepts are provided to the VDCM module 402 composing the VDEV instance 404, so that VDCM 402 may virtualize such intercepted accesses by itself or through interactions with host driver 412. To minimize the software complexity on slow path access emulation, host OS 150 or virtualization providers may restrict guest drivers 424 to use simple memory move operations of eight bytes or less to access VDEV's slow path MMIO resources. VDEV registers that are read frequently and have no read side-effects, but require VDCM intercept and emulation on write accesses, may be mapped as read-only to backing memory pages provided by VCDM. This supports high performance read accesses to these registers along with virtualizing their write side-effects by intercepting on guest write accesses. ‘Write intercept only’ registers must be hosted in separate system page size regions from the ‘read-write intercept’ registers on the VDEV MMIO layout.

3) VDEV MMIO 322 Mapped to Memory 130. VDEV registers that have no read or write side effects may be mapped to primary memory 130 with read and write access. These registers may contain parameters or data for a subsequent operation performed by writing to an intercepted register. Device implementations may also use this approach to define virtual registers for VDEV-specific communication channels between guest driver 424 and VDCM 402. Guest driver 424 writes data to the memory backed virtual registers without host intercepts, followed by a mailbox register access that is intercepted by the VDCM. This optimization reduces host intercept and instruction emulation cost for passing data between guest and host. Such an approach enables guest drivers 424 to implement such channels with VDCM more generally than hardware-based communication doorbells (as is often implemented between SR-IOV VFs 214 and PF 212) or without depending on guest OS or VMM specific para-virtualized software interfaces.

VDEVs 404 expose a virtual MSI or virtual MSI-X capability that is emulated by VDCM 402. Guest driver 424 requests VDEV interrupt resources normally through guest VM 422 interfaces, and the guest VM may service this by programming one or more Interrupt Messages through the virtual MSI or virtual MSI-X capability of VDEV 404.

For typical virtual device compositions, there are two sources of interrupts delivered as VDEV interrupts to guest driver 424. One source is VDCM software 402 itself that may generate virtual interrupts on behalf of the VDEV to be delivered to the guest driver. These are software generated interrupts by the slow path operations of the VDEV emulated by the VDCM. The other source of interrupts is ADI instances 432, 434 on the device that are used to support fast path operations of VDEV 404. ADI generated interrupts use interrupt messages stored in Interrupt Message Storage (IMS) 328.

When guest VM 422 programs the virtual MSI or MSI-X register, the operation is intercepted and virtualized by VDCM 402. For slow path virtual interrupts, the VDCM requests virtual interrupt injection to the guest through the VMM 180 software interfaces. For fast path interrupts from ADIs, the VDCM invokes host driver 412 to allocate and configure required interrupt message address and data in the IMS. This is conceptually similar to how MSI-X interrupts for SR-IOV VFs are virtualized by some virtualization software, except the interrupt messages are programmed in the IMS by host driver 412 as opposed to in an MSI-X table by a PCI driver.

For device-specific usages and reasons, Scalable IOV capable devices 230 may choose to build communication channels between guest driver 424 and VDCM 402. These communication channels can be built in a guest and host system software agnostic manner with either of below methods.

1) Software emulated communication channel. Such a channel is composed by VDCM 402 using one or more system page size regions in VDEV MMIO space set up as fully memory-backed to enable sharing of data between guest VM 422 and host OS 150. A host intercepted system page size region in VDEV MMIO space is also set up to signal a guest action to the host. Optionally, a virtual interrupt may also be setup by the VDCM to signal the guest about completion of asynchronous communication channel actions.

2) Hardware mailbox-based communication channel. If the communication between guest driver 424 and host driver 412 is frequent and the software emulation-based communication channel overhead is significant, Scalable IOV device 230 may implement communication channels based on hardware mailboxes. This is similar to communication channels between SR-IOV VFs 214 and PF 212 in some existing designs.

Shared Virtual Memory (SVM) refers to usages where a device is operating in the CPU virtual address space of the applications sharing the device. SVM usage is enabled with system software programming the DMA remapping hardware to reference the CPU page tables for requests with PASID representing the target applications virtual address space. Devices supporting such SVM capability do not require pages that are accessed by the device to be pinned and instead supports PCI Express Address Translation Services (ATS) and Page Request Service (PRS) capabilities to support recoverable device page faults. Refer to PCI Express specification for details on ATS and PRS capabilities.

A device supporting the Scalable IOV architecture can independently support SVM usages on ADIs allocated to host applications or for ADIs allocated to guest applications through the VDEV instance assigned to guest VM 422. Both the host and guest SVM usages are transparent to the ADI operation. One difference is in the address translation function programming of the Root Complex DMA remapping hardware. The address translation function programmed for PASIDs representing host SVM usage refers to respective CPU virtual address to physical address translation, while the address translation function programmed for PASIDs representing guest SVM usage refers to respective nested address (guest virtual address to guest physical address and further to host physical address) translation.

A set of requirements and capabilities for an endpoint device to support the Scalable IOV architecture will now be described. The requirements apply to both Root-Complex Integrated Endpoint (RCIEP) and PCI Express Endpoint (PCIEP) devices. In an embodiment, the endpoint device may be a NIC, a storage controller, a GPU, a FPGA, an application specific integrated circuit (ASIC), or other circuitry.

As described previously, the Scalable IOV architecture defines the constructs for fine-grained sharing on endpoint devices (i.e., scalable IOV devices 230) as Assignable Device Interfaces (ADIs) 428, 430, 432, 434. ADIs form the unit of assignment and isolation for Scalable IOV capable devices 230 and are composed by software to form virtual devices. The requirements for endpoint devices for enumeration, allocation, configuration, management and isolation of ADIs is as follows.

Resources on an endpoint device associated with fast path work submission, execution and completion operations are referred to as device backend resources.

Assignable Device Interfaces (ADIs) 428, 430, 432, 434 refer to a set of device backend resources 330 that are allocated, configured and organized as an isolated unit, forming the unit of device sharing. The type and number of backend resources grouped to compose an ADI is device specific. For example, for a network controller device (such as an Ethernet NIC), an ADI may be composed of a set of TX/RX queues and resources associated with a Virtual Switch Interface (VSI). An ADI on a storage controller may be the set of command queues and completion queues associated with a storage namespace. Similarly, an ADI on a GPU may be organized as a set of graphics or compute contexts created on behalf of a virtual-GPU device instance. Depending on the design, ADI on an FPGA device may be an entire Accelerator Function Unit (AFU) or a context on a multi-context capable AFU.

The SR-IOV architecture specifies the allocation of PCI Express architectural resources through the VF construct but leaves it to device implementations on how the device backend resources are allocated and associated with specific VFs 214. Devices that want to flexibly provision a variable number of backend resources to VFs 214 (e.g., one queue-pair to a first VF and one queue-pair to another VF) need to implement another level of ‘resource remapping logic’ (as shown at block 308 in FIG. 3 ) within the endpoint device to map which device backend resources 310 are accessible through specific VFs 214 and isolated from access through other VFs. Such resource remapping logic 308 in the endpoint device increases device complexity as the number of VFs and backend resources are scaled.

The SR-IOV software architecture provides for a virtual device instance to be composed of a single VF, whereas the Scalable IOV software architecture of embodiments of the present invention allows software to compose a virtual device (VDEV) instance through the use of one or more ADIs. This enables endpoint device hardware designs to avoid the need for complex resource remapping logic internal to the endpoint device.

For example, consider a device that uses queue-pairs (QPs) 436, 438, 440, 442 as backend resources 330, and a VM 422 that needs eight QPs in the VDEV for its workloads. In the SR-IOV architecture designs will have to map a VF 214 to eight QPs, with either static partitioning of eight QPs per VF, or dynamic partitioning of eight QPs to a VF using resource remapping logic 308 in the endpoint device. An equivalent Scalable IOV capable device design treats each QP as an ADI 428, 430, 432 or 434 and uses VDCM software 402 to compose a VDEV using eight ADIs. In this case the resource remapping functionality is implemented in VDCM 402.

FIG. 5 illustrates an example diagram 500 of a logical view of ADIs with a varying number of device backend resources 330, and virtualization software composing virtual device instances 508, 510, 512 with one or more ADIs 520, 522, 524, 526. There are one or more guest partitions such as guest partition 1 502, guest partition 2 504, . . . guest partition J 506, where J is a natural number, being executed by computing platform 101. There are one or more virtual devices (VDEVs) such as virtual device 1 508, virtual device 2 510, . . . virtual device K 512, where K is a natural number, being executed by computing platform 101. Each guest partition may call one or more virtual devices for I/O requests. For example, guest partition 502 calls virtual device 1 508, guest partition 2 504 calls virtual device 2 510, and so on to guest partition J calls virtual device K 512. There may be any number of guest partitions. There may be any number of virtual devices. The maximum number of virtual devices being called by any one guest partition is implementation dependent. Within endpoint device hardware (i.e., Scalable IOV device 230), there are one or more ADIs, such as ADI 1 520, ADI 2 522, ADI 3 524, . . . ADI M 526, where M is a natural number. There may be any number of ADIs in Scalable IOV device 230 (i.e., it is implementation dependent), and there are one or more Scalable IOV devices (e.g., network I/O devices 110) in computing platform 101. The number of Scalable IOV devices used in a computing platform is implementation dependent. Each ADI uses one or more device backend resources 330. For example, ADI 1 520 uses backend resource 1 528, ADI 2 522 uses backend resource 2 520, ADI 3 524 uses backend resource 3 532, backend resource 4 534, and backend resource 5 536, and ADI M 526 uses backend resource N 538. There may be any number of backend resources in Scalable IOV device 230. The number of backend resources in Scalable IOV device is implementation dependent.

Any virtual device 508, 510, 512 may take a slow path or a fast path for I/O requests. For example, virtual device 1 508 calls slow path software emulation 514 or fast path direct mapping 540 to ADI 1 520. For example, virtual device 1 508 also calls ADI 2 522 via fast path direct mapping 540. For example, virtual device 2 510 calls slow path software emulation 516 or calls ADI 3 524 via fast path direct mapping 542. For example, virtual device K 152 calls slow path software emulation 518 or calls ADI M 526 via fast path direct mapping 544.

Unlike SR-IOV VFs whose requests are tagged with each VF's unique Requester-ID (RID), in embodiments of the present invention requests from all ADIs of a PF are tagged with the RID of the PF. Instead, requests from ADIs are distinguished through a Process Address Space Identifier (PASID) in an end-to-end PASID TLP Prefix. The PCI Express specification defines the Process Address Space Identifier (PASID) in the PASID TLP Prefix of a transaction, which in conjunction with the RID, identifies the address space associated with the request.

The definition of the address space targeted by a PASID value is dependent on the Root Complex DMA remapping hardware capability and the programming of such hardware by software. Computing platforms with Intel® Virtualization Technology for Directed I/O, Rev 3.0 or higher, supports the Scalable IOV architecture through PASID-granular address translation capability. Depending on the programming of such DMA remapping hardware, the address space targeted by a request with PASID can be a Host Physical Address (HPA), Host Virtual Address (HVA), Host I/O Virtual Address (HIOVA), Guest Physical Address (GPA), Guest Virtual Address (GVA), Guest I/O Virtual Address (GIOVA), etc. All of these address space types can coexist on computing platform 101 for different PASID values and ADIs from one or more Scalable IOV devices may be configured to use these PASIDs.

When assigning an ADI to an address domain (e.g., VM 422, container, or process), the ADI is configured with the unique PASID of the address domain and the ADI's memory requests are tagged with the PASID value in the PASID TLP Prefix. If multiple ADIs are assigned to the same address domain, they may be assigned the same PASID. If ADIs belonging to a virtual device (VDEV) assigned to a VM are further mapped to secondary address domains (e.g., application processes) within the VM, each such ADI is assigned a unique PASID corresponding to the secondary address domain. This enables usages such as Shared Virtual Memory (SVM) within a VM, where a guest application process is assigned an ADI, and similar to nested address translation (GVA to GPA to HPA) for CPU accesses by the guest application, requests from the guest's ADI are also subjected to same nested translation by the DMA remapping hardware. Depending on the usage model, an ADI may also be allowed to use more than one PASID value and in this case the semantics of which PASID value to use with which request is Scalable IOV device dependent. For example, an ADI may be configured to access meta-data, commands and completions with one PASID that represents a restricted control domain, while the data accesses are associated with the PASID of the domain to which the ADI is assigned.

In an embodiment, devices 230 supporting the Scalable IOV architecture support the PASID capability as defined by the PCI Express specification and comply with all associated requirements. Before enabling ADIs on a PF 232, the PASID capability on PF 232 is enabled by software. Before an ADI is activated, the ADI is configured with a PASID value. All upstream memory requests (except Address Translation Service (ATS) translated requests) generated by ADIs are tagged with the assigned PASID value using the PASID TLP Prefix. In an embodiment, ADIs are not able to generate memory requests (except ATS translated requests) without a PASID or to generate memory requests with a PASID value in the PASID TLP Prefix that is not the ADI's assigned PASID value.

Each ADI's memory mapped I/O (MMIO) 322 registers are hosted within one or more of the PCI Express Base Address Registers (BARs) 320 of the hosting PF 232. Each ADI's MMIO 322 registers are contained in one or more system page size and aligned regions, and these may be contiguous or scattered regions within the PF's MMIO space 322. The association between the number and location of system page size regions within the PF's MMIO to specific ADIs is device-specific. The system page sizes supported by the Scalable IOV device is reported via the Intel Scalable IOV enumeration capability described below. In an embodiment, for Intel® 64-bit computing platforms, the system page size is 4 kilobytes (KBs).

Devices supporting the Scalable IOV architecture partition their ADI MMIO 322 registers into two categories: (a) MMIO registers accessed frequently for fast path operations; and (b) MMIO registers accessed infrequently for slow path (control, configuration, management etc.) operations. The definition of what operations are designated as slow path versus fast path is device-specific. PF 232 locates registers in these two categories in distinct system page size regions. This enables virtualization software such as host OS/VMM 228 to directly map fast path operations to one or more constituent ADIs while emulating slow path operations in software 514, 516, 518.

In an embodiment, devices implement 64-bit BARs 320 so that the address space above 4 gigabyte (GB) can be used for scaling ADI MMIO 322 resources. Additionally, since non-prefetchable BARs use MMIO space below 4 GB even with 64-bit BARs, in one embodiment devices implement prefetchable 64-bit BARs.

ADIs capable of generating interrupts generate only message signaled interrupts (MSIs) (no legacy interrupts). ADIs do not share interrupt resources/messages with the PF or with another ADI. An ADI may support one or more interrupt messages. For example, an ADI composed of N queues on a PF may support N interrupt messages to distinguish work arrivals or completions for each queue, where N is a natural number.

The Scalable IOV architecture enables device implementations to support a large number of ADIs, and each ADI may use multiple interrupt messages. To support the large interrupt message storage for all ADIs, a device-specific construct called Interrupt Message Storage (IMS) for ADIs 328 is defined. IMS 328 enables devices to store the interrupt messages for ADIs in a device-specific optimized manner without the scalability restrictions of the PCI Express defined MSI-X capability.

Even though the IMS storage organization is device-specific, in one embodiment IMS entries store and generate interrupts using the same interrupt message address and data format as with PCI Express MSI-X table entries. Interrupt messages stored in IMS 328 are composed of a DWORD size data payload and a 64-bit address. IMS 328 may also optionally support per-message masking and pending bit status, similar to the per-vector mask and pending bit array in the PCI Express MSI-X capability. In an embodiment, the IMS resource is programmed by the host driver 412.

PFs hosting the ADIs may support PCI Express defined MSI or MSI-X capability. Interrupts generated by PF 232 may use the PF's MSI or MSI-X capability 326 as specified by the PCI Express specification, while interrupts generated by ADIs may use the device-specific IMS 328. Specific host OS 150/VMM 180 implementations according to embodiments of the present invention support the use of IMS 328 for PF's interrupts and/or the use of PF's MSI-X table for ADI interrupts.

The size, location, and storage format for IMS 328 is device-specific. For example, some devices may implement IMS as on-device storage, while other stateful devices that manage contexts that are saved to and restored from primary memory 130 may implement IMS as part of the context privileged state. In either approach, devices may implement IMS 328 as either one unified storage structure or as de-centralized per ADI storage structures. If IMS 328 is implemented in host primary memory 130, ADIs may cache IMS entries on the Scalable IOV device. If the Scalable IOV device implements IMS caching, the Scalable IOV device also implements device specific interfaces for the device-specific driver to invalidate the IMS cache entries.

IMS 328 is managed by host driver software 412 and is not made accessible directly from guest or user-mode drivers in guest partitions 502, 504, 506. Within the Scalable IOV device, IMS storage is not directly accessible from the ADIs, and instead the ADIs can request interrupt generation only through the PF's ‘Interrupt Message Generation Logic’. This ensures that ADIs cannot modify IMS contents and an ADI can indirectly generate interrupts only using IMS entries assigned by host driver software 412 to the corresponding ADI.

On Intel Architecture (IA) based 64-bit architecture computing platforms, message signaled interrupts are issued as DWORD size untranslated memory writes without a PASID TLP Prefix, to address range 0xFEExxxxx. Since all memory requests generated by ADIs include a PASID TLP Prefix while interrupt messages are generated without a PASID TLP prefix, it is not possible to generate a DMA write to the interrupt message address (0xFEExxxxx on IA based 64-bit computing platforms) through an ADI and cause the platform to interpret the DMA write as an interrupt message.

Operations or functioning of one ADI must not affect functioning of another ADI or functioning of PF 232. Every memory request (except ATS translated requests) from an ADI must be with a PASID TLP Prefix using the ADI's assigned PASID value in the PASID TLP prefix. The PASID identity for an ADI is accessed or modified by privileged software such as through host driver 412.

Since ADIs on Scalable IOV device 230 are part of PF 232, the PCI Express Access Control Service (ACS) capability is not applicable for isolation between ADIs. Instead, devices disable peer-to-peer access (either internal to the device or at I/O fabric egress) between ADIs and between ADIs and the PF. Independent of Scalable IOV architecture support, PF 232 may support ACS guidelines for isolation across endpoint functions or devices, per the PCI Express specification.

Quality of service (QoS) for ADIs are defined specific to a given Scalable IOV device. ADI QoS attributes are managed by host driver 412 and controlled by VDCM 402 through host driver 412 interfaces.

ADI specific errors are errors that can be attributed to a particular ADI such as malformed commands or address translation errors. Such errors do not impact functioning of other ADIs or the PF 232. Handling of ADI specific errors are implemented in device-specific ways.

Each ADI is independently resettable without affecting the operation of other ADIs. However, unlike SR-IOV VFs 214, ADIs do not support Function Level Reset (FLR) capability. Instead, reset of an ADI is performed through software interfaces to host driver 412 via ADI reset configuration 410 as shown in FIG. 4 . To support ADI reset, Scalable IOV devices implement interfaces to abort (e.g., discard) in-flight and accepted operations to the ADI by a specific domain (or PASID). In an embodiment, a VDEV 404 composed out of ADIs may expose a virtual FLR capability that may be emulated by VDCM 402 by requesting host driver 412 to perform the ADI reset for the constituent ADIs 428, 430, 432 or 434 for VDEV 404.

An ADI reset ensures that the reset is not reported as complete until the following conditions are satisfied: a) all DMA write operations by the ADI are drained or aborted; b) all DMA read operations by the ADI have completed or aborted; c) all interrupts from the ADI have been generated; d) if ADI is capable of Address Translation Service (ATS), all ATS requests by the ADI have completed or aborted; and e) if the ADI is capable of Page Request Service (PRS), no more page requests will be generated by the ADI. Additionally, either page responses have been received for all page requests generated by the ADI or the ADI will discard page responses for any outstanding page requests.

In an embodiment, PFs 232 support Function Level Reset (FLR) and may optionally support additional device specific global reset control. Global reset operation and FLR on a PF 232 resets all of its ADIs and returns the PF to a state where no ADIs are configured.

In an embodiment, PFs 232 support saving and restoring ADI state to facilitate operations such as live migration and suspend/resume of virtual devices composed from such ADIs. For example, to support ADI suspend, Scalable IOV devices 230 implement interfaces to drain (i.e., complete) in-flight and accepted operations to the ADI by a specific domain (or PASID). In an embodiment, ADI suspend, ADI state save, ADI state restore, and ADI resume from restored state are also implemented through host driver 412 interfaces.

A PF 232 reports support for the Scalable IOV architecture to system software such as VDCM 402 through the host driver 412 interface. If host driver 412 reports support for the Scalable IOV architecture, host driver 412 supports an extended set of interfaces to enumerate, provision, instantiate, and manage ADIs on the PF. System software such as VDCM 402 performs all Scalable IOV specified operations on Scalable IOV device 230 through host driver 412.

Additionally, in one embodiment, a PCI Express Designated Vendor Specific Extended Capability (DVSEC) is defined for systems software such as VDCM 402 and software tools to detect devices supporting the Scalable IOV architecture, without host driver dependency. Host driver 412 is still responsible for enabling the Scalable IOV architecture and related operations through system software specific interfaces.

FIG. 6 illustrates a diagram of an example Scalable IOV DVSEC structure 600. The fields up to offset 0xA are the standard DVSEC capability header information. Refer to the PCI Express DVSEC header for a detailed description of these fields. The remaining fields are described below.

Function Dependency (DEP) Link (read-only (RO)) field 602 is at offset 0xA and has a size of one byte. The programming model for a device may have vendor-specific dependencies between sets of functions. Function Dependency Link field 602 is used to describe these dependencies. This field describes dependencies between PFs 232. ADI dependencies are the same as the dependencies of their PFs. If a PF 232 is independent from other PFs of a Scalable IOV device 230, this field contains the PF's own Function Number. If a PF is dependent on other PFs of a Scalable IOV device, this field contains the Function Number of the next PF in the same Function Dependency List (FDL). The last PF in a FDL contains the Function Number of the first PF in the FDL.

Dependencies between PFs are described by the Flags field 604 at offset 0xB. Flags field 604 (read only) is at offset 0xB and has a size of one byte. In an embodiment, Flags 604 field includes a homogeneous (H) flag in bit 0 of the byte, and bits 1 through 7 are reserved. When the H flag is reported as set, the H flag indicates that all PFs in the FDL must be enabled (in device-specific manner) for Scalable IOV operation. If some but not all of the PFs in the FDL are enabled for Scalable IOV operation, the behavior is undefined (i.e., one PF cannot be in Scalable IOV operation mode and another in SR-IOV operation mode if the H flag is reported as set). If H flag is not set, PFs in the FDL can be in different modes.

Supported Page Sizes (read only) field 606 is at offset 0xC and has a size of four bytes. Supported Page Sizes field 606 indicates page sizes supported by PF 232. The PF supports a page size of 2^(n+12) if bit n is set. For example, if bit 0 is set, the PF supports 4 KB pages. The page size describes the minimum alignment requirements for ADI MMIO 322 pages so that they can be independently assigned to different address domains. In an embodiment, PFs are required to support 4 KB page sizes. PFs may support additional system page sizes for broad compatibility across host platform architectures.

System Page Size (read-write (RW)) field 608 is at offset 0×10 and has a size of four bytes. System Page Size field 608 defines the page size the system uses to map the ADIs' MMIO 322 pages. Software sets the value of the system page size to one of the page sizes set in the Supported Page Sizes field. As with Supported Page Sizes, if bit n is set in System Page Size, the ADIs associated with this PF support a page size of 2^(n+12). For example, if bit 1 is set, the device uses an 8 KB page size. The behavior is undefined if System Page Size is zero, more than one bit is set, or a bit is set in the System Page Size field that is not set in supported page sizes.

When System Page Size field 608 is written, PF 232 aligns all ADI MMIO 322 resources on system page size boundaries. System page size must be configured before setting the Memory Space Enable bit in the PCI command register of the PF. The behavior is undefined if System Page Size is modified after memory space enable bit is set. A default value is 0000 0001h, indicating a system page size of 4 KB.

Capabilities (read only) field 610 is at offset 0×14 and has a size of four bytes. In an embodiment, Capabilities field 610 includes an IMS Support flag in bit 0, and bits 1 to 31 are reserved. The IMS Support flag indicates support for Interrupt Message Storage (IMS) in the device. When the IMS Support flag is 0, IMS is not supported by the device. When the IMS Support flag is 1, IMS is supported by the device.

If virtualization software (such as VDCM 402) does not support IMS use by the PF itself (IMS use supported only for PFs ADIs), when the PF is directly assigned to a domain, for compatibility, virtualization software may expose a virtual Scalable IOV capability to the domain with the IMS Support flag reported as 0.

In an embodiment, the Scalable IOV architecture relies on the following platform level capabilities: a) support for PCI Express PASID TLP Prefix in supporting Root Ports (RPs), Root Complex (RC), and DMA remapping hardware units (refer to the PCI Express Revision 4.0 specification for details on PASID TLP Prefix support); and b) PASID-granular address translation by DMA remapping hardware such as that defined by scalable mode address translation in Intel® Virtualization Technology (Intel® VT) for Directed I/O (Intel® VT-d), Revision 3.0 or higher.

Scalable mode address translation as defined by Intel® VT-d involves a three-stage address translation. Other embodiments may use other methods. First, the Requester-ID (RID) (Bus/Device/Function numbers) in upstream requests are used to consult the Root and Context structures that specify translation behavior at RID (PF or SR-IOV VF) granularity. The context structures refer to PASID structures. Second, if the request includes a PASID TLP Prefix, the PASID value from the TLP prefix is used to consult the PASID structures that specify translation behavior at PASID (target address domain) granularity. If the request is without a PASID TLP Prefix, the PASID value programmed by software in the Context structure is used instead. For each PASID, the respective PASID structure entry can be programmed to specify first-level, second-level, pass-through or nested translation functions, along with references to first-level and second-level page-table structures. Finally, the address in the request is subject to address translation using the first-level, second-level or both page-table structures, depending on the type of translation function.

The PASID granular address translation enables upstream requests from each ADI on a PF to have a unique address translation. Any such ADIs 428, 430, 432, or 434 on a PF 232 can be used by VDCM 402 to compose virtual devices 404 that may be assigned to any type of address domain (such as guest physical address space of a VM or machine container, I/O virtual address for a bare-metal container, shared CPU virtual address for an application process, or such guest containers or processes operating within a VM).

For interrupt isolation across devices, host system software, such as Host OS 150, VMM 180, and/or VDCM 402 enables interrupt remapping and uses remappable interrupt message format for all interrupt messages programmed in MSI, MSI-X 326, or IS 328 on the device. Refer to the Intel Virtualization Technology for Directed I/O specification for details on interrupt remapping.

In various embodiments, computing platforms supporting the Scalable IOV architecture also support Posted Interrupts capability. Posted Interrupts enables scalable interrupt virtualization by enabling interrupt messages to operate in guest interrupt vector space without consuming host processor interrupt vectors. It additionally enables direct delivery of virtual interrupts to active virtual processors without hypervisor processing overheads. Refer to Intel Virtualization Technology for Directed I/O architecture specification for details on posted interrupts. Posted interrupt operation is transparent to endpoint devices.

FIG. 7 illustrates an example high-level translation structure organization 700 for scalable mode address translation. In an embodiment, scalable mode address translation is accomplished using scalable mode root table 702. Scalable mode root table 702 includes a plurality of entries. In this example, the number of entries in the scalable mode root table is 256, the maximum number of buses possible in computing platform 101. An example entry N 708 in scalable mode root table 702 points to an entry in scalable mode lower context table 710 and to an entry in scalable mode upper context table 712. In an embodiment, there are 128 entries in scalable mode lower context table 710, numbered as device (DEV)=0 entry 714 up to device=15 entry 716 (each of the 16 devices has eight entries). Each entry in scalable mode lower context table specifies a function. Functions IDs are numbers between 0 and 7 in one embodiment. In an embodiment, there are 128 entries in scalable mode upper context table 712, numbered as device=16 entry 718 up to device=31 entry 720 (each of the 16 devices has eight entries). Each entry in scalable mode upper context table specifies a function. A selected entry in either scalable mode lower context table 710 or scalable mode upper context table 712 points to scalable mode PASID directory 722. In an embodiment, there are 2{circumflex over ( )}14 entries in scalable mode PASID directory 722, from entry number 0 724 to entry number 2{circumflex over ( )}14−1 726. The index into the directory is formed from bits 6 through 19 of a PASID in one embodiment. A selected entry in scalable mode PASID directory 722 points to a selected entry in scalable mode PASID table 728. In an embodiment, there are 64 entries in scalable mode PASID table 728, from entry number 0 730 to entry number 63 732. The index into scalable mode PASID table 728 is formed from bits 0 through 5 of a PASID in one embodiment. A selected entry in scalable mode PSID table 728 points to first level page table structures 734 and to second level page table structures 736.

Embodiments of the present invention provide a mechanism for performing live migration of a VM from one server to another server. With S-IOV, the work of creating an emulated interface and a process for migration is implemented in VDCM 402. Hence the system administrator has full control of the configuration for live migration instead of relying on the user in the VM.

FIG. 8 illustrates an example diagram of live migration of a VM. As described above, the S-IOV architecture defines VDCM 402 that is part of the Host OS 150 stack. VDCM 402 is responsible for configuring and managing the composition of VDev 1 804 in Guest VM 1 802. In an embodiment, VDCM 402 detects when a VM is being live migrated and switches the data path (e.g., fast path 806) of VDev 1 804 in guest VM 1 802 to an emulated interface (e.g., slow path SW emulation 808). In one embodiment, this is accomplished using bridge 810. In another embodiment, this is accomplished using a MAC-VTap module (not shown). Thus, the failover of VDEV 1 804 in guest VM 1 802 is seamless and managed by VDCM 402 in the Host OS 150 without a need for intervention by a user. MAC-VTap is a Linux® device driver, based upon the combination of Macvlan and TAP device drivers, that allows for the creation of virtual (tap-like) interfaces. Each virtual network interface is assigned its own MAC and IP address, then attached to the physical interface (also known as the lower interface). Macvlan is a Linux® kernel driver that makes it possible to create virtual network interfaces that can be attached to the physical network adapter (aka the lower interface). TAP is a software only interface that allows user space programs to read and write via TAP device files (/dev/tapN).

In an embodiment, guest VM 1 802 does not need to be aware of the emulated interface (slow path SW emulation 808) for the failover path. Hence there is no additional action needed by the user in guest VM 1 802 to create a team interface between the emulated interface 808 and the fast path interface 806. In an embodiment, VDCM 402 handles the failover to the emulated path. VDCM 402 creates an emulated interface 808 corresponding to each VDEV interface that is created. Then, when the VDEV is ejected, data traffic fails-over to the emulating interface. This makes the present failover solution seamless to the user in guest VM 1 802.

One advantage of a failover solution that is managed by VDCM 402 is that the system administrator does not have to do any additional setup in guest VM 1 802 to create an emulated interface 808 and associate the emulated interface with the fast path 806. Additionally, VDev 1 804 in guest VM 1 802 can continue to run at its best performance level, since there is no overhead introduced by a teaming driver software module on top of it.

VDCM 402 is capable of taking traps on certain inputs from the guest VM. In order to support live migration, VDCM 402 traps into the interrupts that trigger the “hot-unplug” of VDev 1 804 in guest VM 1 802 when the live migration occurs. When the VDCM detects the “hot-unplug” of the VDev, the VDCM switches the data path for that VDev to emulated interface 808 in the host OS 150. Instead of creating a teamed interface in guest VM 1 802 with an additional emulated device inside the guest VM 1, embodiments of the present invention provide for live migration with S-IOV VDevs by pushing the responsibility of switching the data path from VDev1 804 to an emulated interface into VDCM 402.

The emulated interface takes over the data path and the processing of the data traffic remains uninterrupted while the VM is migrated. VDCM 402 removes the hardware dependency and dependency of the Assignable Device Interfaces (ADIs) for fast path 806, and allows for a seamless migration of the data path through emulated interface 808. When live migration is complete, VDCM 402 switches the data path back to fast path 806.

The emulated interface (e.g., slow path SW emulation 808) can be created using one of several methods available in Host OS 150. For example, in Windows® Hyper-V an emulated interface can be created by setting a Virtual NIC's properties such that hardware acceleration is disabled. These settings are options in the Hyper-V Virtual Manager. In Linux®, an emulated interface can be created using either a bridge, or a MAC-VTap, or other constructs that the OS provides.

For each VDEV interface that the administrator creates, VDCM 402 creates an emulated interface. The process used by VDCM 402 to do this depends on which OS is being used.

In an embodiment, the emulated interface is assigned the same MAC address as the VDEV that it is associated with. The emulated interface is set to “standby” mode—that is, the data path for the emulated interface is not enabled. This approach is based on the concept of creating failover teams, where only one interface in the team is active at any time and the team uses the MAC address of the primary adapter in the team. When the active interface fails, the data traffic fails-over to one of the standby interfaces and since this interface uses the same MAC address, there is no traffic disruption.

When the VM is live migrated, any device interfaces that are tied to physical function 232 are “hot-unplugged” (e.g., disconnected). In the S-IOV architecture, the VDEV is hot-unplugged or ejected from the guest VM. This action is trapped by VDCM 402. When VDCM 402 detects that the VDev 1 804 is being ejected, VDCM performs a fail-over of the data path (e.g., fast path 806) to the emulated interface (e.g., slow path SW emulation 808) that is associated with this VDev. In this case, fast path 806 is made inactive and slow path SW emulation 808 is activated. Hence the data traffic going to guest VM 1 802 will continue to flow even though VDev 1 804 has been ejected. This failover concept is based on a teaming model, where some data paths are active and some are in standby mode. Then when the active data path fails, the standby path is made active and the VDev path is made inactive.

There are teaming drivers and approaches already existing that implement this idea. Live migration is a concept that is implemented by various hypervisors. For example, the Windows® Hyper-V allows live migration of a VM that has SR-IOV virtual network devices associated with it. Live migration can be supported with most hypervisors as long as they are using emulated interfaces.

Once the live migration is complete, if the new server running guest VM 802 has an S-IOV capable device, then the administrator can “hot-add” (e.g., connect) VDev 1 804 back into the guest VM. This action can be trapped by the VDCM 402 triggering an interrupt as a result of the “hot-add.” The data traffic can now be transferred on this new VDev 1 804.

FIG. 9 illustrates an example flow diagram of live migration of a VM. At block 902, VDCM 402 in host OS 150 creates a virtual device (VDEV) 804 in a guest VM 802. At block 904, VDCM 402 creates fast path interface 806 for VDEV 804. At block 906, VDCM 402 creates an emulated interface 808 for VDEV 804. Initially, fast path interface 806 is active and emulated interface 808 is in standby mode. At block 908, VDEV transfers data over fast path interface 806 as needed by guest VM 802 and/or physical function 232. If at some point in time guest VM is to be live migrated from one server to another server, at block 910 VDCM 402 detects the “hot un-plugging” of VDEV 804 from guest VM 802. At block 912, VDCM 402 switches data transfers for VDEV 804 from fast path interface 806 to emulated interface 808. In one embodiment, this is done by putting fast path interface into a standby mode and setting emulated interface 808 to active. VDEV then transfers data over emulated interface 808 as needed by guest VM 802 and/or physical function 232. At block 914, host OS 150 performs live migration of guest VM 802 from one server to another server. When the guest VM is up and running on the new server (i.e., live migration completed successfully), VDCM 402 detects the “hot add” of VDEV 804 to guest VM 802. At block 918, VDCM 402 switches data transfer for VDEV 804 from emulated interface 808 back to fast path interface 806. In one embodiment, this is done by putting emulated interface 808 back in standby mode and setting fast path interface 806 to active. Further data transfers for VDEV 804 are performed over fast path interface 806.

FIG. 10 illustrates an example of a storage medium 1000. Storage medium 1000 may comprise an article of manufacture. In some examples, storage medium 1000 may include any non-transitory computer readable medium or machine readable medium, such as an optical, magnetic or semiconductor storage. Storage medium 1000 may store various types of computer executable instructions, such as instructions 1002 to implement logic flows of S-IOV architecture components. Examples of a computer readable or machine-readable storage medium may include any tangible media capable of storing electronic data, including volatile memory or non-volatile memory, removable or non-removable memory, erasable or non-erasable memory, writeable or re-writeable memory, and so forth. Examples of computer executable instructions may include any suitable type of code, such as source code, compiled code, interpreted code, executable code, static code, dynamic code, object-oriented code, visual code, and the like. The examples are not limited in this context.

FIG. 11 illustrates an example computing platform 1100. In some examples, as shown in FIG. 11 , computing platform 1100 may include a processing component 1102, other platform components 1104 and/or a communications interface 1106.

According to some examples, processing component 1102 may execute processing operations or logic for instructions stored on storage medium 900. Processing component 1102 may include various hardware elements, software elements, or a combination of both. Examples of hardware elements may include devices, logic devices, components, processors, microprocessors, circuits, processor circuits, circuit elements (e.g., transistors, resistors, capacitors, inductors, and so forth), integrated circuits, application specific integrated circuits (ASIC), programmable logic devices (PLD), digital signal processors (DSP), field programmable gate array (FPGA), memory units, logic gates, registers, semiconductor device, chips, microchips, chip sets, and so forth. Examples of software elements may include software components, programs, applications, computer programs, application programs, device drivers, system programs, software development programs, machine programs, operating system software, middleware, firmware, software modules, routines, subroutines, functions, methods, procedures, software interfaces, application program interfaces (API), instruction sets, computing code, computer code, code segments, computer code segments, words, values, symbols, or any combination thereof. Determining whether an example is implemented using hardware elements and/or software elements may vary in accordance with any number of factors, such as desired computational rate, power levels, heat tolerances, processing cycle budget, input data rates, output data rates, memory resources, data bus speeds and other design or performance constraints, as desired for a given example.

In some examples, other platform components 1104 may include common computing elements, such as one or more processors, multi-core processors, co-processors, memory units, chipsets, controllers, peripherals, interfaces, oscillators, timing devices, video cards, audio cards, multimedia input/output (I/O) components (e.g., digital displays), power supplies, and so forth. Examples of memory units may include without limitation various types of computer readable and machine readable storage media in the form of one or more higher speed memory units, such as read-only memory (ROM), random-access memory (RAM), dynamic RAM (DRAM), Double-Data-Rate DRAM (DDRAM), synchronous DRAM (SDRAM), static RAM (SRAM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), types of non-volatile memory such as 3-D cross-point memory that may be byte or block addressable. Non-volatile types of memory may also include other types of byte or block addressable non-volatile memory such as, but not limited to, multi-threshold level NAND flash memory, NOR flash memory, single or multi-level PCM, resistive memory, nanowire memory, FeTRAM, MRAM that incorporates memristor technology, STT-MRAM, or a combination of any of the above. Other types of computer readable and machine-readable storage media may also include magnetic or optical cards, an array of devices such as Redundant Array of Independent Disks (RAID) drives, solid state memory devices (e.g., USB memory), solid state drives (SSD) and any other type of storage media suitable for storing information.

In some examples, communications interface 1106 may include logic and/or features to support a communication interface. For these examples, communications interface 1106 may include one or more communication interfaces that operate according to various communication protocols or standards to communicate over direct or network communication links or channels. Direct communications may occur via use of communication protocols or standards described in one or more industry standards (including progenies and variants) such as those associated with the PCIe specification. Network communications may occur via use of communication protocols or standards such those described in one or more Ethernet standards promulgated by IEEE. For example, one such Ethernet standard may include IEEE 802.3. Network communication may also occur according to one or more OpenFlow specifications such as the OpenFlow Switch Specification.

The components and features of computing platform 1100, including logic represented by the instructions stored on storage medium 1000 may be implemented using any combination of discrete circuitry, ASICs, logic gates and/or single chip architectures. Further, the features of computing platform 1100 may be implemented using microcontrollers, programmable logic arrays and/or microprocessors or any combination of the foregoing where suitably appropriate. It is noted that hardware, firmware and/or software elements may be collectively or individually referred to herein as “logic” or “circuit.”

It should be appreciated that the exemplary computing platform 1100 shown in the block diagram of FIG. 11 may represent one functionally descriptive example of many potential implementations. Accordingly, division, omission or inclusion of block functions depicted in the accompanying figures does not infer that the hardware components, circuits, software and/or elements for implementing these functions would necessarily be divided, omitted, or included in embodiments.

Various examples may be implemented using hardware elements, software elements, or a combination of both. In some examples, hardware elements may include devices, components, processors, microprocessors, circuits, circuit elements (e.g., transistors, resistors, capacitors, inductors, and so forth), integrated circuits, ASIC, programmable logic devices (PLD), digital signal processors (DSP), FPGA, memory units, logic gates, registers, semiconductor device, chips, microchips, chip sets, and so forth. In some examples, software elements may include software components, programs, applications, computer programs, application programs, system programs, machine programs, operating system software, middleware, firmware, software modules, routines, subroutines, functions, methods, procedures, software interfaces, application program interfaces (API), instruction sets, computing code, computer code, code segments, computer code segments, words, values, symbols, or any combination thereof. Determining whether an example is implemented using hardware elements and/or software elements may vary in accordance with any number of factors, such as desired computational rate, power levels, heat tolerances, processing cycle budget, input data rates, output data rates, memory resources, data bus speeds and other design or performance constraints, as desired for a given implementation.

Some examples may include an article of manufacture or at least one computer-readable medium. A computer-readable medium may include a non-transitory storage medium to store logic. In some examples, the non-transitory storage medium may include one or more types of computer-readable storage media capable of storing electronic data, including volatile memory or non-volatile memory, removable or non-removable memory, erasable or non-erasable memory, writeable or re-writeable memory, and so forth. In some examples, the logic may include various software elements, such as software components, programs, applications, computer programs, application programs, system programs, machine programs, operating system software, middleware, firmware, software modules, routines, subroutines, functions, methods, procedures, software interfaces, API, instruction sets, computing code, computer code, code segments, computer code segments, words, values, symbols, or any combination thereof.

Some examples may be described using the expression “in one example” or “an example” along with their derivatives. These terms mean that a particular feature, structure, or characteristic described in connection with the example is included in at least one example. The appearances of the phrase “in one example” in various places in the specification are not necessarily all referring to the same example.

Included herein are logic flows or schemes representative of example methodologies for performing novel aspects of the disclosed architecture. While, for purposes of simplicity of explanation, the one or more methodologies shown herein are shown and described as a series of acts, those skilled in the art will understand and appreciate that the methodologies are not limited by the order of acts. Some acts may, in accordance therewith, occur in a different order and/or concurrently with other acts from that shown and described herein. For example, those skilled in the art will understand and appreciate that a methodology could alternatively be represented as a series of interrelated states or events, such as in a state diagram. Moreover, not all acts illustrated in a methodology may be required for a novel implementation.

A logic flow or scheme may be implemented in software, firmware, and/or hardware. In software and firmware embodiments, a logic flow or scheme may be implemented by computer executable instructions stored on at least one non-transitory computer readable medium or machine readable medium, such as an optical, magnetic or semiconductor storage. The embodiments are not limited in this context.

Some examples are described using the expression “coupled” and “connected” along with their derivatives. These terms are not necessarily intended as synonyms for each other. For example, descriptions using the terms “connected” and/or “coupled” may indicate that two or more elements are in direct physical or electrical contact with each other. The term “coupled,” however, may also mean that two or more elements are not in direct contact with each other, but yet still co-operate or interact with each other.

It is emphasized that the Abstract of the Disclosure is provided to comply with 37 C.F.R. Section 1.72(b), requiring an abstract that will allow the reader to quickly ascertain the nature of the technical disclosure. It is submitted with the understanding that it will not be used to interpret or limit the scope or meaning of the claims. In addition, in the foregoing Detailed Description, it can be seen that various features are grouped together in a single example for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed examples require more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive subject matter lies in less than all features of a single disclosed example. Thus, the following claims are hereby incorporated into the Detailed Description, with each claim standing on its own as a separate example. In the appended claims, the terms “including” and “in which” are used as the plain-English equivalents of the respective terms “comprising” and “wherein,” respectively. Moreover, the terms “first,” “second,” “third,” and so forth, are used merely as labels, and are not intended to impose numerical requirements on their objects. 

What is claimed is:
 1. A method comprising: at a source system: a Virtual Device Composition Module (VDCM) composing one or more virtual devices (VDEVs); associating a virtual device of the VDEVs with a virtual machine; assigning at least one assignable device interface (ADI) to the virtual device, wherein: the at least one ADI is allocated for sharing a physical device, the at least one ADI is associated with a Process Address Space Identifier (PASID), the at least one ADI is associated with memory mapped I/O (MMIO) registers hosted within one or more Peripheral Component Interconnect Express (PCIe) Base Address Registers (BARs), at least one Interrupt Message Storage (IMS) entry stores interrupt messages for the least one ADI, and the VDCM, virtual device, the at least one ADI, and the at least one IMS are consistent with a Scalable Input/Output (I/O) Virtualization (S-IOV) specification, creating a first interface for the virtual device; transferring data over the first interface; detecting a disconnection of the virtual device from the virtual machine; and based on a migration of the virtual machine: creating a second interface in the source system for the virtual device; switching data transfers for the virtual device from the first interface to the second interface during the migration.
 2. The method of claim 1, wherein the first interface comprises a fast path interface.
 3. The method of claim 1, wherein the second interface comprises an emulated interface.
 4. The method of claim 1, comprising performing migration of the virtual machine from the source system to a target system after switching data transfers for the virtual device from the first interface to the second interface.
 5. The method of claim 1, wherein detecting the disconnection comprises trapping an interrupt triggering a hot-unplug of the virtual device from the virtual machine.
 6. The method of claim 1, wherein the first and second interfaces transfer data between the virtual device and a physical input/output (I/O) function.
 7. The method of claim 1, comprising: at a target system: connecting the virtual device of the migrated virtual machine to a third interface and switching data transfers for the virtual device from the third interface to a fourth interface.
 8. The method of claim 1, wherein two or more ADIs share a Bus/Device/Function number of a physical function (PF) and two or more ADIs share a same Base Address Register (BAR) resources of the PF.
 9. At least one tangible non-transitory machine-readable medium comprising a plurality of instructions that in response to being executed by at least one processor cause the at least one processor to: execute a Virtual Device Composition Module (VDCM) composing one or more virtual devices (VDEVs); associate a virtual device of the VDEVs with a virtual machine; assign at least one assignable device interface (ADI) to the virtual device, wherein: the at least one ADI is allocated for sharing a physical device, the at least one ADI is associated with a Process Address Space Identifier (PASID), the at least one ADI is associated with memory mapped I/O (MMIO) registers hosted within one or more Peripheral Component Interconnect Express (PCIe) Base Address Registers (BARs), at least one Interrupt Message Storage (IMS) entry stores interrupt messages for the least one ADI, and the VDCM, virtual device, the at least one ADI, and the at least one IMS are consistent with a Scalable Input/Output (I/O) Virtualization (S-IOV) specification, create a first interface for the virtual device in a source system; transfer data over the first interface; detect a disconnection of the virtual device from the virtual machine; and based on a migration of the virtual machine: create a second interface in the source system for the virtual device and switch data transfers for the virtual device from the first interface to the second interface during the migration.
 10. The at least one tangible machine-readable medium of claim 9, wherein the first interface comprises a fast path interface.
 11. The at least one tangible machine-readable medium of claim 9, wherein the second interface comprises an emulated interface.
 12. The at least one tangible machine-readable medium of claim 9, comprising instructions, that in response to being executed by the at least one processor, perform the migration of the virtual machine from the source system to a target system after switching data transfers for the virtual device from the first interface to the second interface.
 13. The at least one tangible machine-readable medium of claim 9, wherein instructions to detect the disconnection comprises instructions to trap an interrupt triggering a hot-unplug of the virtual device from the virtual machine.
 14. The at least one tangible machine-readable medium of claim 9, wherein the first and second interfaces transfer data between the virtual device and a physical input/output (I/O) function.
 15. The at least one tangible machine-readable medium of claim 9, comprising instructions, that in response to being executed by the at least one processor: connect the virtual device of the migrated virtual machine to a third interface and switch data transfers for the virtual device from the third interface to a fourth interface.
 16. A system comprising: at least one processor and a machine-readable storage storing instructions, the instructions executable by the at least one processor to: execute a Virtual Device Composition Module (VDCM) composing one or more virtual devices (VDEVs); execute a virtual machine, associate a virtual device of the VDEVs with the virtual machine, assign at least one assignable device interface (ADI) to the virtual device, wherein: the at least one ADI is allocated for sharing a physical device, the at least one ADI is associated with a Process Address Space Identifier (PASID), the at least one ADI is associated with memory mapped I/O (MMIO) registers hosted within one or more Peripheral Component Interconnect Express (PCIe) Base Address Registers (BARs), at least one Interrupt Message Storage (IMS) entry stores interrupt messages for the least one ADI, and the VDCM, virtual device, the at least one ADI, and the at least one IMS are consistent with a Scalable Input/Output (I/O) Virtualization (S-IOV) specification, create a first interface for the virtual device, transfer data over the first interface, detect a disconnection of the virtual device from the virtual machine, and based on a migration of the virtual machine: create a second interface in the system for the virtual device and switch data transfers for the virtual device from the first interface to the second interface during the migration.
 17. The system of claim 16, wherein the first interface comprises a fast path interface.
 18. The system of claim 16, wherein the second interface comprises an emulated interface.
 19. The system of claim 16, comprising instructions stored on the machine-readable storage, the instructions executable by the at least one processor to perform the migration of the virtual machine from a first server to a second server after switching data transfers for the virtual device from the first interface to the second interface.
 20. The system of claim 19, comprising instructions stored on the machine-readable storage, the instructions executable by the at least one processor to detect reconnection of the virtual device to the virtual machine after the migration of the virtual machine from the first server to the second server.
 21. The system of claim 16, wherein the detect the disconnection comprises trap an interrupt triggering a “hot-unplug” of the virtual device from the virtual machine.
 22. The system of claim 16, comprising a physical input/output (I/O) function, and wherein the first and second interfaces transfer data between the virtual device and the physical I/O function.
 23. The system of claim 16, comprising: a target system comprising: at least one processor and a machine-readable storage storing instructions, the instructions executable by the at least one processor to: connect the virtual device of the migrated virtual machine to a third interface and switch data transfers for the virtual device from the third interface to a fourth interface. 